package com.marvels.financial.task.tasklet;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import com.marvels.common.utils.MarvelsLogUtil;
import com.marvels.financial.loan.service.TimePullWaitLendInfoApi;

/**
 * 自动放款的放款定时处理  放款
 * @author tangpw
 *
 */
public class TimePullWaitLendInfoTasklet implements Tasklet{

	@Autowired
	private TimePullWaitLendInfoApi timePullWaitLendInfoApi;
	
	@Override
	public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
			try{
				MarvelsLogUtil.getInstance().info(">>>>>>>>>>自动放款的放款定时处理开始");
				timePullWaitLendInfoApi.pullWaitLendInfo();
				MarvelsLogUtil.getInstance().info(">>>>>>>>>>自动放款的放款定时处理结束");
			} catch (Throwable e) {
				MarvelsLogUtil.getInstance().error("TimePullWaitLendInfoTasklet-execute-->自动放款的放款定时处理异常:",e);
				throw new Exception("TimePullWaitLendInfoTasklet-execute-->自动放款的放款定时处理异常",e);
			}
			return RepeatStatus.FINISHED;
	}

}
